import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { KsService } from '@/modules/ks/ks.service';
import { KsBindService } from '@/modules/ks/ks.bind.service';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
import { KsUserActionHookService } from './ks.user.action.hook.service';
@Controller("ks")
export class KsController {
  constructor(
    private readonly ksService: KsService,
    private readonly ksBindService: KsBindService,
    private readonly ksUserActionHookService: KsUserActionHookService,
  ) {
  }

  @Get("/tag/suggest")
  @UseGuards(JwtAuthGuard)
  suggestTag(@Query() query: {keyword: string}) {
    return this.ksService.suggestTag(query.keyword)
  }

  @Get("/typelist")
  @UseGuards(JwtAuthGuard)
  getTypeList() {
    return this.ksService.getTypeList()
  }

  @Get("/hook/user")
  hook(@Query() query: {id: number}) {
    return this.ksUserActionHookService.fire(query.id)
  }

}